import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login'
import Home from '@/views/Home'
import Welcome from "@/views/welcome/Welcome"
import User from "@/views/user/User"
import Right from "@/views/right/Right"
import Roles from "@/views/right/Roles"
import Categories from "@/views/category/Categories"
import Goods from "@/views/goods/Goods"
import AddGoods from "@/views/goods/AddGoods"

Vue.use(Router)
/* 创建路由 导出路由 */
export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect:{path:'welcome'},
      children:[
        {path:'welcome',name:'Welcome',component:Welcome},
        {path:'users',name:'User',component:User},
        {path:"rights",name:'Right',component:Right},
        {path:"roles",name:'Roles',component:Roles},
        {path:'categories',name:'Categories',component:Categories},
        {path:'goods',name:'Goods',component:Goods},
        {path:'addgoods',name:'AddGoods',component:AddGoods},
      ]
    },
  ]
})
